home *** CD-ROM | disk | FTP | other *** search
/ MacHome 2001 January / MacHome Magazine Demo Disc January 2001.iso / mac / Software / Networking / InterMapper 3.0 - PPC.sea / InterMapper 3.0 - PPC / InterMapper™ 3.0-PPC / InterMapper™ 3.0-PPC.rsrc / PrTy_155_com.dartware.tcp.http.cgi.post < prev    next >
Encoding:
Text File  |  2000-07-24  |  3.8 KB  |  115 lines

  1. <!-- 
  2.     HTTP (Post) (com.dartware.tcp.http.cgi.post)
  3.     Copyright © 2000 Dartware, LLC. All rights reserved.
  4. -->
  5.  
  6. <header>
  7.     type            =     "tcp-script"
  8.     package            =     "com.dartware"
  9.     probe_name        =    "tcp.http.cgi.post"
  10.     human_name        =    "HTTP (Post)"
  11.     version            =     "1.1"
  12.     address_type    =     "IP"
  13.     port_number        =    "80"
  14.     
  15.     old_protocol    =     "8"            # Backward compat. with old numbering scheme.
  16.     old_script        =     "8121"
  17.  
  18. </header>
  19.  
  20. <description>
  21.  
  22. ≤GB≥Hypertext Transfer Protocol (HTTP) - Post Form Results≤P≥
  23.  
  24. The protocol used to transfer web pages on the World Wide Web, defined in ≤U2≥RFC 2068≤P0≥ and  ≤U2≥RFC 1945≤P0≥.  The default TCP port number for HTTP connections is port 80.
  25.  
  26. This TCP probe lets you post form results to a specific web CGI. 
  27.  
  28. ≤i≥Host Name≤p≥ is the domain name of the web server (e.g. “www.dartware.com”). This can be derived from the host name part of the URL that you want to test.
  29.  
  30. ≤i≥URL Path≤p≥ is the full path to the desired CGI on the web server (e.g. “/index.cgi”). The first character must be a '/'.
  31.  
  32. ≤i≥Form Data≤p≥ is the encoded data sent in the body of the POST message.
  33.  
  34. ≤i≥String to verify≤p≥ is a string to verify in the data returned by the HTTP server.  For example, if you post form data that is designed to generate an error response, you might search for “sorry” or “could not be processed” to verify that the CGI is properly rejecting the data.
  35.  
  36. </description>
  37.  
  38. <parameters>
  39.  
  40. "Host Name"                =     ""
  41. "URL Path"                =    "/action.lasso?-add"
  42. "Form Data"                =    "-database=newIMDB.fp3&-layout=Form+data&-response=%2Fimdemodb%2FIMDemoSuccessForm.html&-reqFieldMissing=%2Fimdemodb%2Fadderror.html"
  43. "String to verify"        =    "we cannot process your request"
  44.  
  45. </parameters>
  46.  
  47. <script>
  48.  
  49. CONN #60 (connect timeout in secs)
  50. WAIT #30 @IDLE (idle timeout in secs)
  51. DISC @DISCONNECT
  52. SEND "POST ${URL Path} HTTP/1.1\r\n"
  53. CHCK "${Host Name}" else goto #+2
  54. SEND "Host: ${Host Name}\r\n"
  55. SEND "Content-type: application/x-www-form-urlencoded\r\n"
  56. SEND "Content-length: ${_LENGTH:${Form Data}}\r\n"
  57. SEND "\r\n"
  58. SEND "${Form Data}"
  59.  
  60. MTCH "HTTP/"i else goto @UNEXPECTED_GREETING
  61. MTCH "200" else goto @UNAVAIL_GET_RESPONSE
  62. LINE OFF
  63. DISC if disconnected goto @NO_MATCH
  64. EXPT "${String to verify}"i else goto @NO_MATCH
  65. DONE OKAY
  66.  
  67. @IDLE:
  68. DONE DOWN "[HTTP (Proxy)] No data for ${_IDLETIMEOUT} seconds.  Was expecting \"${_STRINGTOMATCH}\". [Line ${_IDLELINE}]"
  69.  
  70. @UNEXPECTED_GREETING:
  71. DONE DOWN "[HTTP (Proxy)] Unexpected greeting from port ${_REMOTEPORT}. (${_LINE:50})"
  72.  
  73. @NO_MATCH:
  74. DONE WARN "[HTTP (Proxy)] \"${String to verify}\" not found in returned HTTP data."
  75.  
  76. @UNAVAIL_GET_RESPONSE:
  77. MTCH m"50[0-9]" else goto @BAD_GET_RESPONSE
  78. DONE DOWN "[HTTP (Proxy)] ${_LINE:50} (${URL})"
  79.  
  80. @BAD_GET_RESPONSE:
  81. MTCH "201" ELSE #+2
  82. DONE WARN "[HTTP (Proxy)] 201 Created (${URL})"
  83. MTCH "202" ELSE #+2
  84. DONE WARN "[HTTP (Proxy)] 202 Accepted (${URL})"
  85. MTCH "204" ELSE #+2
  86. DONE WARN "[HTTP (Proxy)] 204 No Content (${URL})"
  87. MTCH "301" ELSE #+2
  88. DONE WARN "[HTTP (Proxy)] 301 Moved Permanently (${URL})"
  89. MTCH "302" ELSE #+2
  90. DONE WARN "[HTTP (Proxy)] 302 Moved Temporarily (${URL})"
  91. MTCH "304" ELSE #+2
  92. DONE WARN "[HTTP (Proxy)] 304 Not Modified (${URL})"
  93. MTCH "400" ELSE #+2
  94. DONE WARN "[HTTP (Proxy)] 400 Bad Request (${URL})"
  95. MTCH "401" ELSE #+2
  96. DONE WARN "[HTTP (Proxy)] 401 Unauthorized (${URL})"
  97. MTCH "403" ELSE #+2
  98. DONE WARN "[HTTP (Proxy)] 403 Forbidden (${URL})"
  99. MTCH "404" ELSE #+2
  100. DONE WARN "[HTTP (Proxy)] 404 Not Found (${URL})"
  101. MTCH "500" ELSE #+2
  102. DONE ALRM "[HTTP (Proxy)] 500 Internal Server Error (${URL})"
  103. MTCH "501" ELSE #+2
  104. DONE ALRM "[HTTP (Proxy)] 501 Not Implemented (${URL})"
  105. MTCH "502" ELSE #+2
  106. DONE ALRM "[HTTP (Proxy)] 502 Bad Gateway (${URL})"
  107. MTCH "503" ELSE #+2
  108. DONE ALRM "[HTTP (Proxy)] 503 Service Unavailable (${URL})"
  109. DONE ALRM "[HTTP (Proxy)] Unknown Error Code ${_LINE:4} (${URL})"
  110.  
  111. @DISCONNECT:
  112. DONE DOWN "[HTTP (Proxy)] Disconnected from port ${_REMOTEPORT} after ${_SECSCONNECTED} seconds."
  113.  
  114. </script>
  115.